package com.example.IoCpractice.Controller;

import com.example.IoCpractice.model.UserInfo;
import com.example.IoCpractice.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-01-12
 * Time: 14:01
 */
@Controller
public class UserController {
    //@Autowired
    /*private UserService userService;

    public UserController() {

    }
    @Autowired
    public UserController(UserService userService) {
        this.userService = userService;
    }*/



    private UserService userService;

    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void say() {
        System.out.println("userController to say!");
        userService.say();
    }



}
